package com.glo.quiki.controller;

import com.glo.quiki.model.QuikiPaymentOrder;
import com.glo.quiki.service.QuikiService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/payment")
@RequiredArgsConstructor
public class PaymentOrderController {

    private final QuikiService quikiService;

    @PostMapping("/orders")
    public ResponseEntity<List<QuikiPaymentOrder>> listPaymentOrders(@RequestParam String email, @RequestParam String password,
                                                                     @RequestParam String startDate, @RequestParam String endDate,
                                                                     @RequestParam(required = false) String rememberCookie) throws Exception {
        return ResponseEntity.ok(quikiService.selectPaymentOrder(email,password,startDate,endDate,rememberCookie));
    }

}